package com.jz.digital.utils;

/**
 * @author jiangdz
 * @date 2024/8/12
 * @time 10:33
 * 用途:数据处理工具类
 */
public class DataUtil {

    public static int toInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
        }
        return 0;
    }

    public static float toFloat(String value) {
        try {
            return Float.parseFloat(value);
        } catch (Exception e) {
        }
        return 0f;
    }

    public static double toDouble(String value) {
        try {
            return Double.parseDouble(value);
        } catch (Exception e) {
        }
        return 0;
    }

    public static long toLong(String value) {
        try {
            return Long.parseLong(value);
        } catch (Exception e) {
        }
        return 0;
    }
}
